<template>
  <z-paging ref="paging" refresher-only @on-refresh="refresh()">
    <dk-diy-page v-if="!loading" :diy-data="diyData">
      <template #default="{ item }">
        <dk-diy-components :item="item" />
      </template>
    </dk-diy-page>
    <u-loading-page icon-size="50" :loading="loading" loading-text="" />
  </z-paging>
</template>

<script>
import { getConfig } from '~/api/config'
import { useUserStore } from '~/stores/user'

export default {
  data() {
    return {
      userData: null,
      diyData: null,
      loading: true,
    }
  },
  onLoad() {
    useUserStore().getUser()
    this.init()
  },
  methods: {
    refresh(){
      useUserStore().getUser()
      this.init()
    },
    init() {
      getConfig('fund_page').then((res) => {
        this.diyData = res.data
        this.loading = false
        this.$refs.paging.complete()
      })
    },
  },
}
</script>

<style>

</style>
